/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cc.altius.domain.mapper;

import cc.altius.model.Customer;
import cc.altius.model.Relation;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.jdbc.core.RowMapper;

/**
 *
 * @author mudassar
 */
public class CustomerRowMapper implements RowMapper<Customer> {

    @Override
    public Customer mapRow(ResultSet rs, int i) throws SQLException {
        Customer customer=new Customer();
        customer.setCustomerId(rs.getInt("pCustomerId"));
        customer.setCustomerName(rs.getString("pCustomerName"));
        customer.setEmpId(rs.getString("pEmpId"));
        Relation relation=new Relation();
        relation.setRelationName(rs.getString("pRelationName"));
        customer.setRelation(relation);
        return customer;
        
    }
    
}
